/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.zonasoft.entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author JORGE
 */
@Entity
@Table(name = "lider_candidato", catalog = "zonificacion", schema = "")
@NamedQueries({
    @NamedQuery(name = "LiderCandidato.findAll", query = "SELECT l FROM LiderCandidato l"),
    @NamedQuery(name = "LiderCandidato.findByIdcadidatoLider", query = "SELECT l FROM LiderCandidato l WHERE l.idcadidatoLider = :idcadidatoLider")})
public class LiderCandidato implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_cadidatoLider", nullable = false)
    private Integer idcadidatoLider;
    @JoinColumn(name = "id_candidato", referencedColumnName = "idcandidato", nullable = false)
    @ManyToOne(optional = false)
    private Candidato idCandidato;
    @JoinColumn(name = "id_lider", referencedColumnName = "idlider", nullable = false)
    @ManyToOne(optional = false)
    private Lider idLider;

    public LiderCandidato() {
    }

    public LiderCandidato(Integer idcadidatoLider) {
        this.idcadidatoLider = idcadidatoLider;
    }

    public Integer getIdcadidatoLider() {
        return idcadidatoLider;
    }

    public void setIdcadidatoLider(Integer idcadidatoLider) {
        this.idcadidatoLider = idcadidatoLider;
    }

    public Candidato getIdCandidato() {
        return idCandidato;
    }

    public void setIdCandidato(Candidato idCandidato) {
        this.idCandidato = idCandidato;
    }

    public Lider getIdLider() {
        return idLider;
    }

    public void setIdLider(Lider idLider) {
        this.idLider = idLider;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idcadidatoLider != null ? idcadidatoLider.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof LiderCandidato)) {
            return false;
        }
        LiderCandidato other = (LiderCandidato) object;
        if ((this.idcadidatoLider == null && other.idcadidatoLider != null) || (this.idcadidatoLider != null && !this.idcadidatoLider.equals(other.idcadidatoLider))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.zonasoft.enridades.LiderCandidato[idcadidatoLider=" + idcadidatoLider + "]";
    }

}
